// TView.cpp : implementation file
//

#include "stdafx.h"
#include "fxtool.h"
#include "TView.h"
#include <d3dx9.h>
#include <D3D9.h>

#include "dxutil.h"
#include "d3dutil.h"
#include "d3dfont.h"
#include "D3DEnumeration.h"
#include "DXUtil.h"
#include "D3DEnumeration.h"
#include "D3DSettings.h"
#include "d3dutil.h"
#include <AniContainer.h>
#include "FxToolDoc.h"
#include "FxToolView.h"
#include "Tview.h"
#include "dxutil.h"
//#include "NarcissusApp.h"
#include "FxCreate.h"
#include "Effect.h"
#include "D3dAddon.h"
#include "EffectView.h"
#include "D3dModel.h"
#include "ToolView2.h"
#include "CHARsheet.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// TView

IMPLEMENT_DYNCREATE(TView, CFormView)

TView::TView()
	: CFormView(TView::IDD)
{
	//{{AFX_DATA_INIT(TView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

TView::~TView()
{
}

void TView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(TView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(TView, CFormView)
	//{{AFX_MSG_MAP(TView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// TView diagnostics

#ifdef _DEBUG
void TView::AssertValid() const
{
	CFormView::AssertValid();
}

void TView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// TView message handlers

void TView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PICTURE_LYU);
	m_LyuCharSheet = new CHARsheet(pwndPropSheetHolder);
	if (!m_LyuCharSheet->Create( pwndPropSheetHolder, WS_CHILD | WS_VISIBLE, 0))
	{
		delete m_LyuCharSheet;
		m_LyuCharSheet = NULL;
		return;
	}

	// fit the property sheet into the place holder window, and show it
	CRect rectPropSheet;
	pwndPropSheetHolder->GetWindowRect(rectPropSheet);
	m_LyuCharSheet->SetWindowPos(NULL, 0, 0, rectPropSheet.Width(), rectPropSheet.Height(),
		SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE );

}
